def _main():
    dic = {
        "黛玉": 0,
        "宝玉": 0,
        "林黛玉": 0,
        "贾宝玉": 0
    }
    with open("hlm.txt", "r") as file_input:
        for line in file_input:
            for word in dic:
                dic[word] += line.count(word)

    result_str = "".join((f" {value} 次 {key} ，" for key, value in dic.items())).rstrip("，")
    print(f"出现了{result_str}。")


if __name__ == "__main__":
    _main()
